#include "HolidayUser.h"

HolidayUser::HolidayUser()
{
}

HolidayUser::~HolidayUser()
{
}

void HolidayUser::link(BookingClass* i, Holiday* j, Management* k)
{
    bc = i;
    hol = j;
    mg = k;
}

void HolidayUser::menu(string username, int HMid)
{
    cout << "Welcome Holiday Manager " << username << " !" << endl
            << "==================================================" << endl << endl;

    bool isExit = false;
    do
    {
        cout << "Please select desired option" << endl << endl
                << "1) Delete Client Account" << endl
                << "2) Manage Checked Bookings" << endl
                << "3) View Package Bookers" << endl
                << "4) Logout" << endl << endl
                << "Your Option: ";

        int opt;
        cin >> opt;
        cin.clear();
        cin.ignore(INT_MAX, '\n');

        switch (opt)
        {
        case 1: option1();
            break;
        case 2: option2(HMid);
            break;
        case 3: option3();
            break;
        case 4: isExit = true;
            break;
        default: cout << "Enter only 1-4 please." << endl;
            break;
        }
    }
    while (isExit == false);
}

void HolidayUser::option1()
{
    cout << endl << "You have selected to delete a client's account." << endl << endl;
    mg->deleteClient();
}

void HolidayUser::option2(int HMid)
{
    cout << endl << "You have selected to manage already checked bookings." << endl << endl;
    bc->checkCheckedBookings(HMid);
}

void HolidayUser::option3()
{
    cout << endl << "You have selected to view the list of clients that have booked a package." << endl << endl;
    hol->listBookers();
}